<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>本地磁盘文件</title>
    <script src="/js/jquery-3.4.1.js"></script>
    <script>

        $(document).ready(function(){
            $.ajax({url:"/fileListLocal",success:function(data){
                    $.each(data.mp4Map, function(i, n){
                        // alert( "Item mp4 #" + i + ": " + n );
                        $("#mp4").append("<a href='/localFiles/"+i+"' target='_blank'>"+i+"</a>").append("&nbsp;&nbsp;<a href='javascript:playFileName(\""+i+"\");'>点这播放</a>").append("<br/>");
                    });
                    $.each(data.otherMap, function(i, n){
                        // alert( "Item #" + i + ": " + n );
                        $("#other").append("<a href='/localFiles/"+i+"' target='_blank'>"+i+"</a><br/>");
                    });
                }});
        });
        function playFileName(fileName) {
            $("#fileName").val(fileName);
            $("#playForm").submit();
        }
        </script>
</head>
<body>
<form id="playForm" action="/playVideo">
    <!--为了传递中文，用post提交参数-->
    <input type="hidden" id="fileName" name="fileName" value=""/>
</form>
<h2>文件</h2>
<div id="other">
</div>
<hr>
<h2>视频</h2>
<div id="mp4">
</div>

</body>
</html>